Performing a media management operation based on a sequence identifier for a block

ABSTRACT

A first block that is assigned a first sequence identifier can be identified. A determination can be made as to whether the assigned first sequence identifier satisfies a threshold sequence identifier condition that corresponds to a difference between the first sequence identifier assigned to the first block and second sequence identifier assigned to a second block. In response to determining that the assigned first sequence identifier satisfies the threshold sequence identifier condition, a media management operation can be performed on the first block.

TECHNICAL FIELD

Embodiments of the disclosure relate generally to memory sub-systems,and more specifically, relate to performing a media management operationbased on a sequence identifier for a block.

BACKGROUND

A memory sub-system can include one or more memory devices that storedata. The memory devices can be, for example, non-volatile memorydevices and volatile memory devices. In general, a host system canutilize a memory sub-system to store data at the memory devices and toretrieve data from the memory devices.

BRIEF DESCRIPTION OF THE DRAWINGS

The present disclosure will be understood more fully from the detaileddescription given below and from the accompanying drawings of variousembodiments of the disclosure.

FIG. 1 illustrates an example computing system that includes a memorysub-system in accordance with some embodiments of the presentdisclosure.

FIG. 2 is a flow diagram of an example method to perform a mediamanagement operation based on a sequence identifier for a block inaccordance with some embodiments of the present disclosure.

FIG. 3 is a flow diagram of an example method to determine whether toperform a media management operation on a block based on a sequenceidentifier in accordance with some embodiments of the presentdisclosure.

FIGS. 4A-4D illustrate an example of consolidating valid data from coldstatic blocks in accordance with some embodiments of the presentdisclosure.

FIG. 5 is a flow diagram of an example method to consolidate cold blocksthrough consolidating valid data from the cold blocks in accordance withsome embodiments of the present disclosure.

FIG. 6 is a block diagram of an example computer system in whichembodiments of the present disclosure may operate.

DETAILED DESCRIPTION

Aspects of the present disclosure are directed to performing a mediamanagement operation based on a sequence identifier for a block. Amemory sub-system can be a storage device, a memory module, or a hybridof a storage device and memory module. Examples of storage devices andmemory modules are described below in conjunction with FIG. 1. Ingeneral, a host system can utilize a memory sub-system that includes oneor more components, such as memory devices that store data. The hostsystem can provide data to be stored at the memory sub-system and canrequest data to be retrieved from the memory sub-system.

A memory device can be a non-volatile memory device. A non-volatilememory device is a package of one or more dice. Each die can consist ofone or more planes. For some types of non-volatile memory devices (e.g.,negative-and (NAND) devices), each plane consists of a set of physicalblocks. Each block consists of a set of pages. Each page consists of aset of memory cells, which store bits of data. For some memory devices,such as NAND devices, blocks are the smallest area than can be erasedand pages within the blocks cannot be erased individually. For suchdevices, erase operations are performed one block at a time. A page of ablock can contain valid data, invalid data, or no data. Invalid data isdata that is marked as outdated as a new version of the data is storedon the memory device. Invalid data includes data that was previouslywritten but is no longer associated with a valid logical address, suchas a logical address referenced by a host system in a physical tological (P2L) mapping table. Valid data is the most recent version ofsuch data being stored on the memory device. A memory sub-system canmark data as invalid based on information received, for example, from anoperating system. A page that does not contain data includes a page thathas been previously erased, and not yet written to.

A memory sub-system controller can perform operations for mediamanagement algorithms, such as wear leveling, refresh, garbagecollection, scrub, etc. A block may have some pages containing validdata and some pages containing invalid data. To avoid waiting for all ofthe pages in the block to have invalid data in order to erase and reusethe block, an algorithm hereinafter referred to as “garbage collection”can be invoked to allow the block to be erased and released as a freeblock for subsequent write operations. Garbage collection is a set ofmedia management operations that include, for example, selecting a blockthat contains valid and invalid data, selecting pages in the block thatcontain valid data, copying the valid data to new locations (e.g., freepages in another block), marking the data in the previously selectedpages as invalid, and erasing the selected block.

Since garbage collection can write the valid data to a different blockbefore the block is erased, data can be rewritten many times todifferent blocks at the memory sub-system. The amount of additionalrewrites of data in the memory sub-system is referred to herein aswrite-amplification. Write-amplification can reduce the operating lifeof a memory sub-system. To reduce write-amplification, the memorysub-system can include some amount of additional blocks in excess to atotal number of blocks that are available at any single time to storedata from the host system. Such additional blocks can be consideredover-provisioning. A larger amount of over-provisioning cansignificantly reduce write-amplification as the number of times thatdata is rewritten within the memory sub-system due to garbage collectionattempting to free up blocks is reduced.

“Garbage collection operation” hereinafter refers to selecting a block,rewriting the valid data from the selected block to a new block, anderasing all invalid data and valid data stored at the selected block.The valid data from multiple selected blocks can be copied to a smallernumber of new blocks and the selected blocks can then be erased. As aresult, the number of blocks that have been erased can be increased sothat more blocks are available to store subsequent data from a hostsystem.

To select a block on which the garbage collection operation is to beperformed, the conventional memory sub-system selects the block with theleast amount of valid data as less valid data is required to berewritten from the selected block to a new block before the selectedblock is erased. In some circumstances, a block can include data that isvalid for a relatively long period of time. Such data is referred to ascold data. If a block includes a large amount of valid cold data, thenthe garbage collection operation may not be performed on the block. As aresult, fewer garbage collection operations are performed on the blockcompared to other blocks with lesser amounts of valid data that will beselected by the garbage collection operation. Since the garbagecollection operation is not performed on the blocks with large amountsof valid cold data, a significant amount of the capacity of the memorysub-system is locked up in blocks that contain some amount of invalidalong with the valid cold data. The number of blocks that store colddata reduces the amount of overprovisioning in the memory sub-system andtherefore causes an increase in write-amplification as additional writeoperations are performed on other blocks and are not performed on theblocks with the valid cold data.

Aspects of the present disclosure address the above and otherdeficiencies by performing a garbage collection operation based on asequence identifier (e.g., number) for a block. The performance of sucha garbage collection operation can increase the operating lifespan ofthe memory sub-system by increasing the amount of available blocks thatcan store data from a host system and thus decrease write amplification.The reduced write amplification can provide for improved performance ofthe memory sub-system as fewer write operations are performed as part ofthe garbage collection operation.

The garbage collection operation can select a block to be erased so thatthe block can be made available to store subsequent data from a hostsystem. For example, the memory sub-system can identify blocks that havelarge version gaps that indicate that a respective block includes colddata. The identified blocks can then be garbage collected. The validdata garbage collected from the identified blocks is then consolidatedinto fewer blocks to reduce the number of blocks that store cold data.

FIG. 1 illustrates an example computing system 100 that includes amemory sub-system 110 in accordance with some embodiments of the presentdisclosure. The memory sub-system 110 can include media, such as one ormore volatile memory devices (e.g., memory device 140), one or morenon-volatile memory devices (e.g., memory device 130), or a combinationof such.

A memory sub-system 110 can be a storage device, a memory module, or ahybrid of a storage device and memory module. Examples of a storagedevice include a solid-state drive (SSD), a flash drive, a universalserial bus (USB) flash drive, an embedded Multi-Media Controller (eMMC)drive, a Universal Flash Storage (UFS) drive, a secure digital (SD)card, and a hard disk drive (HDD). Examples of memory modules include adual in-line memory module (DIMM), a small outline DIMM (SO-DIMM), andvarious types of non-volatile dual in-line memory modules (NVDIMMs). Thecomputing system 100 can be a computing device such as a desktopcomputer, laptop computer, network server, mobile device, a vehicle(e.g., airplane, drone, train, automobile, or other conveyance),Internet of Things (IoT) enabled device, embedded computer (e.g., oneincluded in a vehicle, industrial equipment, or a networked commercialdevice), or such computing device that includes memory and a processingdevice.

The computing system 100 can include a host system 120 that is coupledto one or more memory sub-systems. In some embodiments, the host system120 is coupled to different types of memory sub-systems 110. FIG. 1illustrates one example of a host system 120 coupled to one memorysub-system 110. As used herein, “coupled to” or “coupled with” generallyrefers to a connection between components, which can be an indirectcommunicative connection or direct communicative connection (e.g.,without intervening components), whether wired or wireless, includingconnections such as electrical, optical, magnetic, etc.

The host system 120 can include a processor chipset and a software stackexecuted by the processor chipset. The processor chipset can include oneor more cores, one or more caches, a memory controller (e.g., NVDIMMcontroller), and a storage protocol controller (e.g., PCIe controller,SATA controller). The host system 120 uses the memory sub-system 110,for example, to write data to the memory sub-system 110 and read datafrom the memory sub-system 110.

The host system 120 can be coupled to the memory sub-system 110 via aphysical host interface. Examples of a physical host interface include,but are not limited to, a serial advanced technology attachment (SATA)interface, a peripheral component interconnect express (PCIe) interface,universal serial bus (USB) interface, Fibre Channel, Serial AttachedSCSI (SAS), a double data rate (DDR) memory bus, Small Computer SystemInterface (SCSI), a dual in-line memory module (DIMM) interface (e.g.,DIMM socket interface that supports Double Data Rate (DDR)), Open NANDFlash Interface (ONFI), Double Data Rate (DDR), Low Power Double DataRate (LPDDR), or any other interface. The physical host interface can beused to transmit data between the host system 120 and the memorysub-system 110. The host system 120 can further utilize an NVM Express(NVMe) interface to access components (e.g., memory devices 130) whenthe memory sub-system 110 is coupled with the host system 120 by thePCIe interface. The physical host interface can provide an interface forpassing control, address, data, and other signals between the memorysub-system 110 and the host system 120. FIG. 1 illustrates a memorysub-system 110 as an example. In general, the host system 120 can accessmultiple memory sub-systems via a same communication connection,multiple separate communication connections, and/or a combination ofcommunication connections.

The memory devices 130, 140 can include any combination of the differenttypes of non-volatile memory devices and/or volatile memory devices. Thevolatile memory devices (e.g., memory device 140) can be, but are notlimited to, random access memory (RAM), such as dynamic random accessmemory (DRAM) and synchronous dynamic random access memory (SDRAM).

Some examples of non-volatile memory devices (e.g., memory device 130)include negative-and (NAND) type flash memory and write-in-place memory,such as a three-dimensional cross-point (“3D cross-point”) memorydevice, which is a cross-point array of non-volatile memory cells. Across-point array of non-volatile memory can perform bit storage basedon a change of bulk resistance, in conjunction with a stackablecross-gridded data access array. Additionally, in contrast to manyflash-based memories, cross-point non-volatile memory can perform awrite in-place operation, where a non-volatile memory cell can beprogrammed without the non-volatile memory cell being previously erased.NAND type flash memory includes, for example, two-dimensional NAND (2DNAND) and three-dimensional NAND (3D NAND).

Each of the memory devices 130 can include one or more arrays of memorycells. One type of memory cell, for example, single level cells (SLC)can store one bit per cell. Other types of memory cells, such asmulti-level cells (MLCs), triple level cells (TLCs), and quad-levelcells (QLCs), can store multiple bits per cell. In some embodiments,each of the memory devices 130 can include one or more arrays of memorycells such as SLCs, MLCs, TLCs, QLCs, or any combination of such. Insome embodiments, a particular memory device can include an SLC portion,and an MLC portion, a TLC portion, or a QLC portion of memory cells. Thememory cells of the memory devices 130 can be grouped as pages that canrefer to a logical unit of the memory device used to store data. Withsome types of memory (e.g., NAND), pages can be grouped to form blocks.

Although non-volatile memory components such as a 3D cross-point arrayof non-volatile memory cells and NAND type flash memory (e.g., 2D NAND,3D NAND) are described, the memory device 130 can be based on any othertype of non-volatile memory, such as read-only memory (ROM), phasechange memory (PCM), self-selecting memory, other chalcogenide basedmemories, ferroelectric transistor random-access memory (FeTRAM),ferroelectric random access memory (FeRAM), magneto random access memory(MRAM), Spin Transfer Torque (STT)-MRAM, conductive bridging RAM(CBRAM), resistive random access memory (RRAM), oxide based RRAM(OxRAM), negative-or (NOR) flash memory, and electrically erasableprogrammable read-only memory (EEPROM).

A memory system controller 115 (or controller for simplicity) cancommunicate with the memory devices 130 to perform operations such asreading data, writing data, or erasing data at the memory devices 130and other such operations. The memory sub-system controller 115 caninclude hardware such as one or more integrated circuits and/or discretecomponents, a buffer memory, or a combination thereof. The hardware caninclude a digital circuitry with dedicated (i.e., hard-coded) logic toperform the operations described herein. The memory sub-systemcontroller 115 can be a microcontroller, special purpose logic circuitry(e.g., a field programmable gate array (FPGA), an application specificintegrated circuit (ASIC), etc.), or other suitable processor.

The memory sub-system controller 115 can include a processor 117 (e.g.,a processing device) configured to execute instructions stored in alocal memory 119. In the illustrated example, the local memory 119 ofthe memory sub-system controller 115 includes an embedded memoryconfigured to store instructions for performing various processes,operations, logic flows, and routines that control operation of thememory sub-system 110, including handling communications between thememory sub-system 110 and the host system 120.

In some embodiments, the local memory 119 can include memory registersstoring memory pointers, fetched data, etc. The local memory 119 canalso include read-only memory (ROM) for storing micro-code. While theexample memory sub-system 110 in FIG. 1 has been illustrated asincluding the memory sub-system controller 115, in another embodiment ofthe present disclosure, a memory sub-system 110 does not include amemory sub-system controller 115, and can instead rely upon externalcontrol (e.g., provided by an external host, or by a processor orcontroller separate from the memory sub-system).

In general, the memory sub-system controller 115 can receive commands oroperations from the host system 120 and can convert the commands oroperations into instructions or appropriate commands to achieve thedesired access to the memory devices 130. The memory sub-systemcontroller 115 can be responsible for other operations such as wearleveling operations, garbage collection operations, error detection anderror-correcting code (ECC) operations, encryption operations, cachingoperations, and address translations between a logical address (e.g.,logical block address (LBA)) and a physical address (e.g., physicalblock address) that are associated with the memory devices 130. Thememory sub-system controller 115 can further include host interfacecircuitry to communicate with the host system 120 via the physical hostinterface. The host interface circuitry can convert the commandsreceived from the host system into command instructions to access thememory devices 130 as well as convert responses associated with thememory devices 130 into information for the host system 120.

The memory sub-system 110 can also include additional circuitry orcomponents that are not illustrated. In some embodiments, the memorysub-system 110 can include a cache or buffer (e.g., DRAM) and addresscircuitry (e.g., a row decoder and a column decoder) that can receive anaddress from the controller 115 and decode the address to access thememory devices 130.

In some embodiments, the memory devices 130 (and or memory device 140)include local media controllers 135 that operate in conjunction withmemory sub-system controller 115 to execute operations on one or morememory cells of the memory devices 130. An external controller (e.g.,memory sub-system controller 115) can externally manage the memorydevice 130 (e.g., perform media management operations on the memorydevice 130). In some embodiments, a memory device 130 is a managedmemory device, which is a raw memory device combined with a localcontroller (e.g., local controller 135) for media management within thesame memory device package. An example of a managed memory device is amanaged NAND (MNAND) device.

The memory sub-system 110 includes a consolidation component 113 thatcan be used to consolidate cold data from cold static blocks to performa garbage collection operation in the memory sub-system 110. In someembodiments, the memory sub-system controller 115 includes at least aportion of the consolidation component 113.

The consolidation component 113 can determine whether a sequence numberassigned to a block satisfies a threshold sequence number condition. Theconsolidation component 113 can determine whether the block satisfies avalid data criterion. The consolidation component 113 can then garbagecollect the block and consolidate valid data into specified cold blocks.Further details with regards to the operations of the consolidationcomponent 113 are described below.

FIG. 2 is a flow diagram of an example method 200 to perform a mediamanagement operation based on a sequence number for a block inaccordance with some embodiments of the present disclosure. The method200 can be performed by processing logic that can include hardware(e.g., processing device, circuitry, dedicated logic, programmablelogic, microcode, hardware of a device, integrated circuit, etc.),software (e.g., instructions run or executed on a processing device), ora combination thereof. In some embodiments, the method 200 is performedby the consolidation component 113 of FIG. 1. Although shown in aparticular sequence or order, unless otherwise specified, the order ofthe processes can be modified. Thus, the illustrated embodiments shouldbe understood only as examples, and the illustrated processes can beperformed in a different order, and some processes can be performed inparallel. Additionally, one or more processes can be omitted in variousembodiments. Thus, not all processes are required in every embodiment.Other process flows are possible.

At operation 210, the processing logic identifies a first block that isassigned a first sequence number. The first block can include both validand invalid data. A sequence number can be assigned to a block each timea block is written to and therefore the first sequence numbercorresponds to a length of time since the first block was last writtento. In some embodiments, a memory sub-system can increment a sequencenumber for each write operation that is performed to store data at ablock. The incremented sequence number can then be assigned to the blockstoring the data of the corresponding write operation. In the same oralternative embodiments, the sequence number can be incremented for eachoperation (e.g., write operation, read operation, erase operation) thatis performed by the memory sub-system. Thus, the sequence number can beindicative of when a write operation has been performed relative toother operations that have been performed by the memory sub-system. Thevalid data stored in the first block can be all, or at least partially,cold data.

At operation 220, the processing logic determines whether the firstsequence number satisfies a threshold sequence number condition. Thethreshold sequence number condition corresponds to a difference betweenthe first sequence number assigned to the first block and a secondsequence number assigned to a second block. In some embodiments, thefirst sequence number satisfies the threshold sequence number conditionwhen the first sequence number assigned to the first block is equal toor exceeds a threshold difference between the sequence numbers. Thefirst sequence number does not satisfy the threshold sequence numbercondition when the first sequence number assigned to the first block isless than the threshold difference between the sequence numbers. Forexample, the threshold sequence number can be a minimum specifieddifference between the first and second sequence numbers. The secondblock can be the last block that the memory sub-system has written to.Therefore, the difference between the first and second sequence numbersrepresents a number of write operations (or number of any operations)that have occurred since the first block was last written to, or“programmed.” The difference can be referred to as a “version gap.” Theversion gap can become large enough to satisfy the threshold sequencenumber when the first block contains some amount of cold data such thatthe first block is not garbage collected under normal garbage collectioncriteria.

At operation 230, in response to determining that the assigned firstsequence number satisfies the threshold sequence number condition, theprocessing logic performs a media management operation, such as agarbage collection operation, on the first block. For example, thememory sub-system can copy the valid data stored in the first block to adestination block and then erase the first block. The valid data copiedfrom the first block can be mostly, if not all, cold data. Thedestination block can be a block that is assigned to store cold data.The destination block can be randomly designated, or alternatively canbe selected based on previous use of the destination block. Multipledestination blocks can be designated at any one time and differentdestination blocks can be designated at different times. The destinationblock can store valid data that is garbage collected from blockscontaining cold valid data. Thus, cold valid data collected from blocksthat meet the threshold sequence number condition can be consolidatedinto one or more blocks, such as the destination block, that areassigned to store consolidated cold data. In some instances, the memorysub-system performs the garbage collection operation on the first blockonly if the first block contains a minimum or maximum amount of validdata.

FIG. 3 is a flow diagram of an example method 300 to determine whetherto perform a media management operation on a block based on a sequencenumber, in accordance with some embodiments of the present disclosure.The method 300 can be performed by processing logic that can includehardware (e.g., processing device, circuitry, dedicated logic,programmable logic, microcode, hardware of a device, integrated circuit,etc.), software (e.g., instructions run or executed on a processingdevice), or a combination thereof. In some embodiments, the method 300is performed by the consolidation component 113 of FIG. 1. Althoughshown in a particular sequence or order, unless otherwise specified, theorder of the processes can be modified. Thus, the illustratedembodiments should be understood only as examples, and the illustratedprocesses can be performed in a different order, and some processes canbe performed in parallel. Additionally, one or more processes can beomitted in various embodiments. Thus, not all processes are required inevery embodiment. Other process flows are possible.

At operation 310, the processing logic receives an instruction toperform a media management operation, such as a garbage collectionoperation. The garbage collection operation is an operation to copyvalid data from a source block to a destination block and then erase thesource block. Garbage collection helps to remove invalid data stored ina memory sub-system. At operation 320, the processing logic determines asequence number that is assigned to a first block. The sequence numberrepresents the last time data was written to the first block. A sequencenumber can be assigned to the block each time that data is written tothe block. Thus, the sequence number can represent a relative age of thedata in the block with respect to other data stored at other blocks atthe memory sub-system.

At operation 330, the processing logic determines whether to perform themedia management operation on the first block based on the sequencenumber assigned to the first block or to perform the media managementoperation on a second block based on an amount of invalid data stored atthe second block. The determination can be based on a difference betweenthe sequence number assigned to the first block and a sequence numberassigned to the block that was most recently written to by the memorysub-system. The difference can represent a number of block that havebeen written to since the first block was last written to. In oneembodiment, if the difference between the sequence number assigned tothe first block and the sequence number assigned to the block mostrecently written to is larger than a threshold sequence numberdifference then the garbage collection operation will be performed onthe first block. Alternatively, if the difference does not meet thethreshold sequence number difference then the garbage collection willnot be performed on the first block. Rather, the garbage collectionoperation can select a second block based on the amount of invalid datastored at the second block. For example, the second block can be a blockthat contains the largest amount of invalid data, or the least amount ofvalid data. The determination can additionally be based on an amount ofvalid data that is stored in the first block. For example, if the firstblock contains a very high amount of valid data (e.g., 99.9%) then thegarbage collection operation is not done on the first block. Thus, thecriteria used to select the block for the garbage college operation canbe changed based on the sequence number assigned to the block.

At operation 340, processing logic performs the media managementoperation on the first block in response to determining that thesequence number assigned to the first block satisfies a thresholdsequence number condition. As described above, the threshold sequencenumber condition can be a difference between the sequence numberassigned to the first block and the sequence number of the last blockthat was written to. Thus, the threshold sequence number condition canbe satisfied if the difference between the sequence number of the firstblock and the sequence number of the last block is equal to or largerthan the threshold sequence number difference. The threshold sequencenumber condition is not satisfied if the difference between the sequencenumber of the first block and the sequence number of the last block isless than the threshold sequence number difference. Upon performing thegarbage collection operation, the valid data is consolidated with validdata from other block that have been garbage collected based on asequence number. The consolidation of the valid data can free up memoryin the system because less memory is trapped as invalid data in coldblocks.

FIGS. 4A-4D illustrate an example series of operations to consolidatevalid data from cold static blocks in accordance with some embodimentsof the present disclosure. Referring to FIG. 4A, blocks 410, 412, and414 each store some amount of valid data and invalid data where validdata is represented by “v” and invalid data is represented by “x”.Blocks 420 and 422 can initially be empty, not storing any data. Forexample, blocks 420 and 422 could have been recently been garbagecollected and/or erased. Each sub-block of the blocks 410, 412, 414,420, and 422 can be a unit of storage (e.g., a word line, a page, etc.).FIG. 4A depicts the blocks prior to a garbage collection operation beingperformed on the blocks 410, 412, and 414.

Referring to FIG. 4B, block 410 has been garbage collected and the validdata that was stored at block 410 in FIG. 4A is now stored at block 420.As described above in FIG. 2 and FIG. 3, the block 410 is garbagecollected based on a sequence number assigned to block 410. Accordingly,the valid data from block 410 is copied to block 420, after which thedata at block 410 is erased. The valid data copied from block 410 toblock 420 is likely to be mostly cold data because the garbagecollection operation was done based on the sequence number. Block 420and 422 can each be designated as blocks to store cold data that isgarbage collected so that cold data is consolidated in blocks 420 and422. Referring to FIG. 4C, the valid data that was stored at block 412in FIG. 4B has been copied into block 420 and block 422. Similar to FIG.4B, a garbage collection operation performed on block 412 can copy thevalid data of block 412 to the designated cold blocks 420 and 422 anderase the data at block 412. The valid data can be partially copied toblock 420 and partially to block 422.

Referring to FIG. 4D, the valid data from block 414 has been copied intoblock 422. All the valid data that was originally stored in blocks 410,412, and 414 in FIG. 4A now resides in blocks 420 and 422. The coldvalid data from the cold blocks is therefore consolidated into as fewblocks as possible. Accordingly, the amount of available blocks that canstore subsequent data has increased by 50% from 2 full blocks to 3 fullblocks. Each of the blocks 410, 412, and 414 has been garbage collectedand the valid data consolidated into blocks 420 and 422. It should benoted that FIGS. 4A-4D are illustrative and should not be construed aslimited to the operations depicted. Other operations can occurthroughout each of the operations depicted (e.g., read and writeoperations). Additionally, each of the blocks depicted can be locatedanywhere in a memory sub-system and are not required to be proximate toone another.

FIG. 5 is a flow diagram of an example method 500 to consolidate coldblocks with invalid data, in accordance with some embodiments of thepresent disclosure. The method 500 can be performed by processing logicthat can include hardware (e.g., processing device, circuitry, dedicatedlogic, programmable logic, microcode, hardware of a device, integratedcircuit, etc.), software (e.g., instructions run or executed on aprocessing device), or a combination thereof. In some embodiments, themethod 500 is performed by the consolidation component 113 of FIG. 1.Although shown in a particular sequence or order, unless otherwisespecified, the order of the processes can be modified. Thus, theillustrated embodiments should be understood only as examples, and theillustrated processes can be performed in a different order, and someprocesses can be performed in parallel. Additionally, one or moreprocesses can be omitted in various embodiments. Thus, not all processesare required in every embodiment. Other process flows are possible.

At operation 510, the processing logics begins a media managementoperation, such as a garbage collection operation. A garbage collectionoperation can copy valid data of a block to a destination block anderase the data at the block. The garbage collection operation is used tofree up blocks with invalid data.

At operation 520, the processing logic determines whether any blockshave a version gap exceeding a threshold version gap. A version gaprepresents the relative age of data in a block with respect to data ofother blocks. The version gap can be the difference between a sequencenumber of a block and the latest sequence number assigned to the lastblock that was written to. Alternatively, the version gap can be thedifference between the next sequence number that is to be assigned andthe sequence number assigned to a block. If a version gap of a blockexceeds the threshold version gap then the block can contain cold datapreventing the block from being garbage collected under normalconditions (i.e., the block with the least amount of valid data isgarbage collected).

At operation 530, if a version gap of a block exceeds the thresholdversion gap at operation 520, then the processing logic determineswhether the block satisfies a valid data criteria. The valid datacriteria can be a range of valid data (e.g., a minimum percentage ofvalid data and a maximum percentage of valid data) that is stored at theblock. The valid data criteria can be a maximum amount of valid data,ratio of valid data to invalid data stored at the block, or percentageof valid data or invalid data. Thus, the valid data criteria can besatisfied by a block with an amount of valid data that falls within therange defined by the valid data criteria (i.e., more than a minimumamount and less than a maximum amount). The valid data criteria is notsatisfied by a block with an amount of valid data that is outside of therange defined by the valid data criteria (i.e., more than a minimumamount and less than a maximum amount). At operation 540, if the blockmeets both the threshold version gap and satisfies the valid datacriteria, then the processing logic performs the media managementoperation (e.g., the garbage collection operation) on the block. Thegarbage collection operation copies the valid data from the data to adestination block that is to store valid cold data. Once the valid datais copied, the data at the block is erased.

At operation 550, if either the version gap threshold is not exceeded orthe valid data criteria is not satisfied for any block, then theprocessing logic determines whether any blocks satisfy an erase countgap threshold. The erase count gap threshold can be satisfied by a blockwith an erase count gap that exceeds or is equal to the erase count gapthreshold. The erase count gap is the erase count difference between theblock with most number of erases and the block with the least number oferases. The erase count can be used as a proxy for the age of the block.As it can be desirable for the blocks to experience wear evenly, if anyblock has a smaller erase count (e.g., because it was not picked forgarbage collection due to an inherently larger amount of valid data whencompared to other blocks), the system can forcibly perform garbagecollection on that block for wear leveling purposes in spite of thelarger amount of valid data. The erase count gap threshold is notsatisfied by a block with an erase count gap that does not exceed theerase count gap threshold. If a block satisfies an erase count gapthreshold then a wear leveling operation can be initiated. Wear levelingcan be another operation performed on blocks that have a low erase countin comparison to other blocks (and thus a large erase count gap). Thus,wear leveling is utilized to more evenly distribute write operationsacross blocks so that all blocks have a similar operational lifespan asa result of having a similar number of write operations performed withina defined period of time.

At operation 560, if a block has an erase count gap that satisfies theerase count gap threshold then the processing logic performs the mediamanagement operation on the block that meets the erase count gapthreshold (i.e. wear leveling). At operation 570, if none of the blocksmeet the erase count gap threshold then the processing logic performsthe media management operation on the data bock with the least amount ofvalid data. The least amount of valid data can be the least absoluteamount of valid data or a lowest ratio of valid to invalid data.Similarly, the garbage collection operation could be performed on theblock with the largest amount of invalid data.

FIG. 6 illustrates an example machine of a computer system 600 withinwhich a set of instructions, for causing the machine to perform any oneor more of the methodologies discussed herein, can be executed. In someembodiments, the computer system 600 can correspond to a host system(e.g., the host system 120 of FIG. 1) that includes, is coupled to, orutilizes a memory sub-system (e.g., the memory sub-system 110 of FIG. 1)or can be used to perform the operations of a controller (e.g., toexecute an operating system to perform operations corresponding to theconsolidation component 113 of FIG. 1). In alternative embodiments, themachine can be connected (e.g., networked) to other machines in a LAN,an intranet, an extranet, and/or the Internet. The machine can operatein the capacity of a server or a client machine in client-server networkenvironment, as a peer machine in a peer-to-peer (or distributed)network environment, or as a server or a client machine in a cloudcomputing infrastructure or environment.

The machine can be a personal computer (PC), a tablet PC, a set-top box(STB), a Personal Digital Assistant (PDA), a cellular telephone, a webappliance, a server, a network router, a switch or bridge, or anymachine capable of executing a set of instructions (sequential orotherwise) that specify actions to be taken by that machine. Further,while a single machine is illustrated, the term “machine” shall also betaken to include any collection of machines that individually or jointlyexecute a set (or multiple sets) of instructions to perform any one ormore of the methodologies discussed herein.

The example computer system 600 includes a processing device 602, a mainmemory 604 (e.g., read-only memory (ROM), flash memory, dynamic randomaccess memory (DRAM) such as synchronous DRAM (SDRAM) or Rambus DRAM(RDRAM), etc.), a static memory 606 (e.g., flash memory, static randomaccess memory (SRAM), etc.), and a data storage system 618, whichcommunicate with each other via a bus 630.

Processing device 602 represents one or more general-purpose processingdevices such as a microprocessor, a central processing unit, or thelike. More particularly, the processing device can be a complexinstruction set computing (CISC) microprocessor, reduced instruction setcomputing (RISC) microprocessor, very long instruction word (VLIW)microprocessor, or a processor implementing other instruction sets, orprocessors implementing a combination of instruction sets. Processingdevice 602 can also be one or more special-purpose processing devicessuch as an application specific integrated circuit (ASIC), a fieldprogrammable gate array (FPGA), a digital signal processor (DSP),network processor, or the like. The processing device 602 is configuredto execute instructions 626 for performing the operations and stepsdiscussed herein. The computer system 600 can further include a networkinterface device 608 to communicate over the network 620.

The data storage system 618 can include a machine-readable storagemedium 624 (also known as a computer-readable medium) on which is storedone or more sets of instructions 626 or software embodying any one ormore of the methodologies or functions described herein. Theinstructions 626 can also reside, completely or at least partially,within the main memory 604 and/or within the processing device 602during execution thereof by the computer system 600, the main memory 604and the processing device 602 also constituting machine-readable storagemedia. The machine-readable storage medium 624, data storage system 618,and/or main memory 604 can correspond to the memory sub-system 110 ofFIG. 1.

In one embodiment, the instructions 626 include instructions toimplement functionality corresponding to a consolidation component(e.g., the consolidation component 113 of FIG. 1). While themachine-readable storage medium 624 is shown in an example embodiment tobe a single medium, the term “machine-readable storage medium” should betaken to include a single medium or multiple media that store the one ormore sets of instructions. The term “machine-readable storage medium”shall also be taken to include any medium that is capable of storing orencoding a set of instructions for execution by the machine and thatcause the machine to perform any one or more of the methodologies of thepresent disclosure. The term “machine-readable storage medium” shallaccordingly be taken to include, but not be limited to, solid-statememories, optical media, and magnetic media.

Some portions of the preceding detailed descriptions have been presentedin terms of algorithms and symbolic representations of operations ondata bits within a computer memory. These algorithmic descriptions andrepresentations are the ways used by those skilled in the dataprocessing arts to most effectively convey the substance of their workto others skilled in the art. An algorithm is here, and generally,conceived to be a self-consistent sequence of operations leading to adesired result. The operations are those requiring physicalmanipulations of physical quantities. Usually, though not necessarily,these quantities take the form of electrical or magnetic signals capableof being stored, combined, compared, and otherwise manipulated. It hasproven convenient at times, principally for reasons of common usage, torefer to these signals as bits, values, elements, symbols, characters,terms, numbers, or the like.

It should be borne in mind, however, that all of these and similar termsare to be associated with the appropriate physical quantities and aremerely convenient labels applied to these quantities. The presentdisclosure can refer to the action and processes of a computer system,or similar electronic computing device, that manipulates and transformsdata represented as physical (electronic) quantities within the computersystem's registers and memories into other data similarly represented asphysical quantities within the computer system memories or registers orother such information storage systems.

The present disclosure also relates to an apparatus for performing theoperations herein. This apparatus can be specially constructed for theintended purposes, or it can include a general purpose computerselectively activated or reconfigured by a computer program stored inthe computer. Such a computer program can be stored in a computerreadable storage medium, such as, but not limited to, any type of diskincluding floppy disks, optical disks, CD-ROMs, and magnetic-opticaldisks, read-only memories (ROMs), random access memories (RAMs), EPROMs,EEPROMs, magnetic or optical cards, or any type of media suitable forstoring electronic instructions, each coupled to a computer system bus.

The algorithms and displays presented herein are not inherently relatedto any particular computer or other apparatus. Various general purposesystems can be used with programs in accordance with the teachingsherein, or it can prove convenient to construct a more specializedapparatus to perform the method. The structure for a variety of thesesystems will appear as set forth in the description below. In addition,the present disclosure is not described with reference to any particularprogramming language. It will be appreciated that a variety ofprogramming languages can be used to implement the teachings of thedisclosure as described herein.

The present disclosure can be provided as a computer program product, orsoftware, that can include a machine-readable medium having storedthereon instructions, which can be used to program a computer system (orother electronic devices) to perform a process according to the presentdisclosure. A machine-readable medium includes any mechanism for storinginformation in a form readable by a machine (e.g., a computer). In someembodiments, a machine-readable (e.g., computer-readable) mediumincludes a machine (e.g., a computer) readable storage medium such as aread only memory (“ROM”), random access memory (“RAM”), magnetic diskstorage media, optical storage media, flash memory components, etc.

In the foregoing specification, embodiments of the disclosure have beendescribed with reference to specific example embodiments thereof. Itwill be evident that various modifications can be made thereto withoutdeparting from the broader spirit and scope of embodiments of thedisclosure as set forth in the following claims. The specification anddrawings are, accordingly, to be regarded in an illustrative senserather than a restrictive sense.

What is claimed is:
 1. A method comprising: identifying a first blockthat is assigned a first sequence identifier; determining, by aprocessing device, whether the assigned first sequence identifiersatisfies a threshold sequence identifier condition that corresponds toa difference between the first sequence identifier assigned to the firstblock and a second sequence identifier assigned to a second block; andin response to determining that the assigned first sequence identifiersatisfies the threshold sequence identifier condition, performing amedia management operation on the first block.
 2. The method of claim 1,wherein the first sequence identifier is indicative of when data waslast written to the first block and the second sequence identifier isindicative of when data was last written to the second block.
 3. Themethod of claim 1, wherein the difference between the first sequenceidentifier and the second sequence identifier corresponds to aidentifier of blocks that have been written to since data was written tothe first block.
 4. The method of claim 1, further comprising: inresponse to determining that the first sequence identifier does notsatisfy the threshold sequence identifier condition, determining to notperform the media management operation on the first block.
 5. The methodof claim 1, further comprising: determining whether the first blockincludes a threshold amount of valid data, wherein performing the mediamanagement operation on the first block is further in response todetermining that the first block does not include the threshold amountof valid data.
 6. The method of claim 5, wherein the media managementoperation comprises a garbage collection operation corresponding tostoring valid data from the first block with valid data from a thirdblock that is assigned a particular sequence identifier that satisfiesthe threshold sequence identifier condition.
 7. The method of claim 1,wherein the second block is a last block that has been written to andthe second sequence identifier that is assigned to the second block is alast sequence identifier that has been assigned to the last block thathas been written to.
 8. A system comprising: a memory component; and aprocessing device, operatively coupled with the memory component, to:receive an indication to perform a media management operation on a blockof a plurality of blocks; determine a sequence identifier that isassigned to a first block of the plurality of blocks; determine whetherto perform the media management operation on the first block based onthe sequence identifier that is assigned to the first block or toperform the media management operation on a second block of theplurality of blocks based on an amount of valid data stored at thesecond block, the determination being based on the sequence identifierthat is assigned to the first block; and in response to determining thatthe sequence identifier assigned to the first block satisfies athreshold sequence identifier condition, perform the media managementoperation on the first block.
 9. The system of claim 8, wherein theprocessing device is further to: in response to determining that thesequence identifier assigned to the first block does not satisfy thethreshold sequence identifier condition, perform the media managementoperation on the second block.
 10. The system of claim 9, wherein thesecond block includes a least amount of valid data of the plurality ofblocks.
 11. The system of claim 8, wherein performing the mediamanagement on the first block is further in response to determining thatthe first block includes less than a threshold amount of valid data. 12.The system of claim 8, wherein the media management operation comprisesa garbage collection operation to store valid data from the first blockwith valid data from a third block, wherein the garbage collectionoperation has been previously performed on the third block based onanother sequence identifier assigned to the third block.
 13. The systemof claim 8, wherein determining whether to perform the media managementoperation on the first block is based at least in part on a differencebetween a last sequence identifier assigned to a last block that waswritten to and the sequence identifier assigned to the first block andat least in part on a difference between a number of times that thefirst block has been erased and a number of times that the last blockhas been erased.
 14. The system of claim 13, wherein the sequenceidentifier corresponds to when data was last written to the first block,and wherein the difference corresponds to a identifier of writeoperations that have been performed since data was last written to thefirst block.
 15. A non-transitory computer-readable storage mediumcomprising instructions that, when executed by a processing device,cause the processing device to: identify a first block that is assigneda first sequence identifier; determine whether the first sequenceidentifier satisfies a threshold sequence identifier condition thatcorresponds to a difference between the first sequence identifierassigned to the first block and a second sequence identifier assigned toa second block; and in response to determining that the first sequenceidentifier satisfies the threshold sequence identifier condition,perform a media management operation on the first block.
 16. Thenon-transitory computer-readable storage medium 15, wherein the firstsequence identifier is indicative of when data was last written to thefirst block.
 17. The non-transitory computer-readable storage medium 15,wherein the difference between the first sequence identifier and thesecond sequence identifier corresponds to a identifier of blocks thathave been written to since data was last written to the first block. 18.The non-transitory computer-readable storage medium 15, wherein theprocessing device is further to: in response to determining that thefirst sequence identifier does not satisfy the threshold sequenceidentifier condition, determine to not perform the media managementoperation on the first block.
 19. The non-transitory computer-readablestorage medium 15, wherein the processing device is further to:determine whether the first block includes a threshold amount of validdata, wherein performing the media management operation on the firstblock is further in response to determining that the first block doesnot include the threshold amount of valid data.
 20. The non-transitorycomputer-readable storage medium 15, wherein the media managementoperation comprises a garbage collection operation corresponding tostoring a portion of data from the first block with another portion ofdata from another block that is assigned a particular sequenceidentifier that also satisfies the threshold sequence identifiercondition.